import type { PageParams, PageResult } from '@/types/common'
import type { CategoryItem, GuessItem, HotItem } from '@/types/home'
import { myGet, myRequest } from '@/utils/request'

/**
 * 首页-前台分类
 */
export const getHomeCategoryAPI = () => {
  return myGet<CategoryItem[]>('/home/category/mutli')
}

/**
 * 首页-热门推荐
 */
export const getHomeHotAPI = () => {
  return myGet<HotItem[]>('/home/hot/mutli')
}

/**
 * 猜你喜欢
 */
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  // return myGet<PageResult<GuessItem>>('/home/goods/guessLike', data)
  return myRequest<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    params: data,
    custom: {
      loading: false
    }
  })
}
